testentryicons: Set tooltips on all icons
authorDaniel Boles <dboles.src@gmail.com>
Mon, 31 Jul 2017 18:33:38 +0000 (19:33 +0100)
committerDaniel Boles <dboles@src.gnome.org>
Mon, 31 Jul 2017 19:01:30 +0000 (20:01 +0100)
Just to test tooltips in all cases; what was already here
should have been sufficient, but this doesn't hurt.

While here, also add some instructive placeholder text.

https://bugzilla.gnome.org/show_bug.cgi?id=780938

tests/testentryicons.c

index a6e21c060dde6b06936531c579e46cd2207992df..41196a2158cee1861d4681d6b3f725b39a0b87fb 100644 (file)
@@ -190,14 +190,25 @@ main (int argc, char **argv)
   gtk_widget_set_hexpand (entry, TRUE);
   gtk_grid_attach (GTK_GRID (grid), entry, 1, 2, 1, 1);
 
+  gtk_entry_set_placeholder_text (GTK_ENTRY (entry),
+                                  "Type some text, then click an icon");
+
   gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
                                      GTK_ENTRY_ICON_PRIMARY,
                                      "edit-find-symbolic");
 
+  gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
+                                   GTK_ENTRY_ICON_PRIMARY,
+                                   "Clicking the other icon is more interesting!");
+
   gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
                                      GTK_ENTRY_ICON_SECONDARY,
                                      "edit-clear-symbolic");
 
+  gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
+                                   GTK_ENTRY_ICON_SECONDARY,
+                                   "Clear");
+
   g_signal_connect (entry, "icon-press", G_CALLBACK (clear_pressed), NULL);
 
   /*
@@ -221,6 +232,10 @@ main (int argc, char **argv)
                                  GTK_ENTRY_ICON_PRIMARY,
                                  FALSE);
 
+  gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
+                                   GTK_ENTRY_ICON_PRIMARY,
+                                   "The password is hidden for security");
+
   /* Name - Does not set any icons. */
   label = gtk_label_new ("Name:");
   gtk_grid_attach (GTK_GRID (grid), label, 0, 4, 1, 1);
@@ -229,6 +244,11 @@ main (int argc, char **argv)
 
   entry = gtk_entry_new ();
   gtk_widget_set_hexpand (entry, TRUE);
+  gtk_entry_set_placeholder_text (GTK_ENTRY (entry),
+                                  "Use the RadioButtons to choose an icon");
+  gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
+                                   GTK_ENTRY_ICON_SECONDARY,
+                                   "Use the RadioButtons to change this icon");
   gtk_grid_attach (GTK_GRID (grid), entry, 1, 4, 1, 1);
 
   box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);